//
//  HBIncomeDetailListCell.m
//  HuoBao
//
//  Created by chaiyanan on 15/12/7.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "HBIncomeDetailListCell.h"

@interface HBIncomeDetailListCell ()

@end

@implementation HBIncomeDetailListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundColor = [LCCommon getColor:@"e1e1e1"];
        [self createCustomView];
    }
    return self;
}

- (void)createCustomView
{
    self.incomeLable = [self createLableWithTextColor:[LCCommon getColor:@"666666"] font:[UIFont systemFontOfSize:16.0f] text:@"13228.76" textAlignment:NSTextAlignmentLeft frame:CGRectMake(15, 0, SCREEN_WIDTH-100, Height_HBIncomeDetailListCell) superView:self.contentView];
    
    UIImage *arrowImage = [UIImage imageNamed:@"bank_cardList"];
    UIImageView *arrowImageView = [[UIImageView alloc]initWithImage:arrowImage];
    arrowImageView.frame = CGRectMake(SCREEN_WIDTH-15-arrowImage.size.width, (Height_HBIncomeDetailListCell-arrowImage.size.height)/2.0f, arrowImage.size.width, arrowImage.size.height);
    [self.contentView addSubview:arrowImageView];
    
    self.timeLable = [self createLableWithTextColor:[LCCommon getColor:@"888888"] font:[UIFont systemFontOfSize:11.0f] text:@"11-30 收益" textAlignment:NSTextAlignmentRight frame:CGRectMake(SCREEN_WIDTH-(15+arrowImage.size.width+100), 0, 90, Height_HBIncomeDetailListCell) superView:self.contentView];
    
    [self createSepratorLineWithFrame:CGRectMake(0, Height_HBIncomeDetailListCell-1-1/([UIScreen mainScreen].scale), SCREEN_WIDTH, 1/([UIScreen mainScreen].scale)) backgroundColor:[LCCommon getColor:@"cccccc"] superView:self.contentView];
}

- (UILabel *)createLableWithTextColor:(UIColor *)color font:(UIFont *)font text:(NSString *)text textAlignment:(NSTextAlignment)textAlignment frame:(CGRect)frame superView:(UIView *)superView
{
    UILabel *lable = [[UILabel alloc]initWithFrame:frame];
    lable.textColor = color;
    lable.font = font;
    lable.text = text;
    lable.textAlignment = textAlignment;
    [superView addSubview:lable];
    return lable;
}

- (UIView *)createSepratorLineWithFrame:(CGRect)frame backgroundColor:(UIColor *)bgColor superView:(UIView *)superView
{
    UIView *sepratorLine = [[UIView alloc]initWithFrame:frame];
    sepratorLine.backgroundColor = bgColor;
    [superView addSubview:sepratorLine];
    return sepratorLine;
}

@end
